<?php
namespace Home\Model;
use Think\Model;

class DetailModel extends Model {
	public function getDetail(){

		$data = $this->table(array('orders'=>'o','detail'=>'d'))->field('o.u_id,o.linkman,o.addtime,o.total,o.status,d.*')->where('d.orderid=o.id and o.status=2')->select();

		
		foreach($data as $key => $val){
			date_default_timezone_set("PRC");  //设置中国时区
			$data[$key]['addtime'] = date('Y-m-d H:i:s',$data[$key]['addtime']);
			
		}

		
		
		//dump($data);
		return $data;
	}
} 